function bodyReady() {	
}
function sendForm () {
	var xval = x_value();
	var yval = y_value();
	var rval = r_value();
	var msg = [];
	if ( ! xval.valid)
		msg.push(xval.msg);
	if ( ! yval.valid)
		msg.push(yval.msg);
	if ( ! rval.valid)
		msg.push(rval.msg);
	
	var validContainer = getByClass('valid').item(0);
	if (msg.length > 0) {
		validContainer.innerHTML = "";
		msg.forEach(function(message){
			validContainer.innerHTML += message + "<br />";
		});
		validContainer.style.color = "red";
	}
	else {
		validContainer.innerHTML = "Данные введены верно";
		validContainer.style.color = "blue";
		ajax("LabServlet/checkPoint", "POST", {
			params: {
				x: xval.value,
				y: yval.value,
				r: rval.value
			},
			success: function (response) {
                
                var str = "<table border=\"1\"><tr><th>X</th><th>Y</th><th>R</th><th>Result</th></tr>";
                response.points.forEach(function(p){
                    str += "<tr><td>"+p.x+"</td><td>"+p.y+"</td><td>"+p.r+"</td><td>"+p.contains+"</td></tr>";
                });
                str += "</table>";
                
				getByClass('response').item(0).innerHTML = str;
			}
		});
	}
}